// src/router/router.js
import PersonalCenter from "@/views/percenter/PersonalCenter.vue";

const routes = [
    {
        path: '/',
        redirect: '/personal' // 将根路径重定向到 /personal
    },
    {
        path: '/personal',
        component: PersonalCenter,
        children: [
            {
                path: 'profile',
                name: 'ProfileEdit',
                component: () => import('../../views/percenter/ProfileEdit.vue')
            },
            {
                path: 'posts',
                name: 'Posts',
                component: () => import('../../views/percenter/Posts.vue')
            },
            {
                path: 'followers',
                name: 'Followers',
                component: () => import('../../views/percenter/Followers.vue')
            },
            {
                path: 'favorites',
                name: 'Favorites',
                component: () => import('../../views/percenter/Favorites.vue')
            },
            {
                path: 'feedback',
                name: 'Feedback',
                component: () => import('../../views/percenter/Feedback.vue')
            },
            {
                path: 'privacy',
                name: 'PrivacySettings',
                component: () => import('../../views/percenter/PrivacySettings.vue')
            },
            {
                path: 'deactivate',
                name: 'DeactivateAccount',
                component: () => import('../../views/percenter/DeactivateAccount.vue')
            },
            // 默认重定向到个人资料
            {
                path: '',
                redirect: { name: 'ProfileEdit' }
            }
        ]
    }
];

export default routes;